package com.chixing.controller;

import com.chixing.util.OCR.AppCodeDriver;
import com.chixing.util.OCR.AppCodeIdCard;
import com.chixing.util.OCR.IdCardCertification;
import com.chixing.util.ServerResponse;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
/**
 * @author 马博
 * * @date 2021/10/8
 */
@RestController
public class FileUploadController {
    //身份证
    @PostMapping("uploadSingleFileAjax/person")
    public ServerResponse uploadSingleFileAjax(@RequestParam("myimage") MultipartFile multipartFile, HttpServletRequest request) throws Exception {
        ServerResponse serverResponse=AppCodeIdCard.personCard(multipartFile);
        //IdCardCertification
        /*ServerResponse serverResponse1=AppCodeIdCard.personCard(multipartFile);
        ServerResponse serverResponse=IdCardCertification.personCard(multipartFile,serverResponse1);*/
        return serverResponse;
    }

    //驾驶证
    @PostMapping("uploadSingleFileAjax/car")
    public ServerResponse uploadCarSingleFileAjax(@RequestParam("carimage") MultipartFile multipartFile,HttpServletRequest request) throws Exception {
        ServerResponse serverResponse = AppCodeDriver.driverCard(multipartFile);
        return serverResponse;
    }
}
